<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<!--调整模态框-->
<div class="modal fade" data-keyboard="false" id="modal-create-project">
    <div class="modal-dialog" style="width:1000px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h3 class="modal-title">库存信息调整</h3>
            </div>
            <div class="modal-body">
                <form id="projectForm" class="form-horizontal">
                    <input type="hidden" id="ityId" name="ityId">
                    <div class="row">
                        <div class="col-md-8 col-md-offset-2">
                            <div class="form-group">
                                <label class="col-sm-2 text-right">物料描述</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="adjMatDesc"
                                           style="width: 440px" placeholder="" readonly>
                                    <input type="hidden" name="matFormulaType">
                                    <input type="hidden" name="matHeight">
                                    <input type="hidden" name="matLength">
                                    <input type="hidden" name="matWidth">
                                    <input type="hidden" name="matSpecId">
                                    <input type="hidden" name="matId">
                                </div>
                                <div class="col-sm-2">
                                    <button type="button" class="btn btn-info pull-right"
                                            id="btn-chooseMaterial" onclick="openDailyDesc('')">选择
                                    </button>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">在库数量</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" name="ityNum"
                                           oninput="clearNoNum(this)" onchange="clearNoNum(this)" placeholder=""
                                           style="width: 185px" id="ityNum">
                                </div>
                                <label class="col-sm-4 text-right">在库重量</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="ityWeight" placeholder=""
                                           style="width: 185px" id="ityWeight" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">单价</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" name="ityPrice"
                                           oninput="clearNoNum(this)" onchange="clearNoNum(this)"
                                           style="width: 185px">
                                </div>
                                <label class="col-sm-4 text-right">金额</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="ityAmount"
                                           style="width: 185px" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">可用数量</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" name="ityAvaNum"
                                           style="width: 185px" placeholder="" readonly>
                                </div>
                                <label class="col-sm-4 text-right">可用重量</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="ityAvaWeight"
                                           style="width: 185px" placeholder="" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">跟踪号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="ityTrackCode" placeholder="" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">在库类型</label>
                                <div class="col-sm-10">
                                    <select name="ityInType" class="form-control" disabled>
                                        <option value="1">库存</option>
                                        <option value="2">项目</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">特殊说明</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="itySpec" placeholder="" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">项目编号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="ityProCode" placeholder="" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">项目名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="ityProName" placeholder="" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">备注</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="ityRemark" placeholder="" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">调整原因</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="adjReason" placeholder="">
                                </div>
                            </div>

                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-change-project">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--新增库存信息模态框-->
<div class="modal fade" data-keyboard="false" id="modal-create-stock">
    <div class="modal-dialog" style="width:1000px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h3 class="modal-title">新增库存信息</h3>
            </div>
            <div class="modal-body">
                <form id="projectFormStock" class="form-horizontal">
                    <input type="hidden" name="matFormulaType">
                    <input type="hidden" name="matHeight">
                    <input type="hidden" name="matLength">
                    <input type="hidden" name="matWidth">
                    <input type="hidden" name="matSpecId">
                    <input type="hidden" name="matId">
                    <div class="row">
                        <div class="col-md-8 col-md-offset-2">
                            <div class="form-group">
                                <label class="col-sm-2 text-right">物料描述 </label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="adjMatDesc"
                                           style="width: 440px" placeholder="物料描述" readonly>
                                </div>
                                <div class="col-sm-2">
                                    <button type="button" class="btn btn-info pull-right"
                                            id="btn-chooseMaterialStock" onclick="openDailyDesc('')">选择
                                    </button>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">库位</label>
                                <div class="col-sm-4">
                                    <!--<input type="text" class="form-control" name="msName" placeholder="库位"
                                           style="width: 190px">-->
                                    <select name="msName" class="form-control">
                                    <option value="">请选择</option>
                                    <option th:each="type:${warehouse}" th:value="${type.whiId}"
                                            th:text="${type.whiName}"
                                            th:selected="${type.whiName eq '原料库'}"></option>
                                    </select>
                                </div>
                                <!--<label class="col-sm-4 text-right">区位</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="msSpace" placeholder="区位"
                                           style="width: 190px" readonly>
                                </div>-->
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">在库数量</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" name="adjAfterNum"
                                           oninput="clearNoNum(this)" onchange="clearNoNum(this)" placeholder="在库数量"
                                           style="width: 190px">
                                </div>
                                <label class="col-sm-4 text-right">在库重量</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="adjAfterWeight" placeholder="在库重量"
                                           style="width: 190px" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">单价</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" name="adjPrice"
                                           oninput="clearNoNum(this)" onchange="clearNoNum(this)"
                                           style="width: 190px">
                                </div>
                                <label class="col-sm-4 text-right">金额</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" name="adjAmount"
                                           style="width: 190px" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">回货日期</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control datepicker" name="adjBackDate"
                                           style="width: 190px" readonly>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">在库类型</label>
                                <div class="col-sm-10">
                                    <select name="adjInType" class="form-control">
                                        <option value="1">库存</option>
                                        <option value="2">项目</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">跟踪号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="adjTrackCode" placeholder="请填写跟踪号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">特殊说明</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="adjSpec" placeholder="请填写特殊说明">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">项目编号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="adjProjectCode" name="adjProjectCode" placeholder="请添加8位项目编号" maxlength="8">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">项目名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="adjProjectName" name="adjProjectName" placeholder="请添加项目名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 text-right">调整原因</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="adjReason" placeholder="请填写调整原因">
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-change-Stock">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--调整选择物料信息模态框-->
<div class="modal fade" data-backdrop="static" data-keyboard="false" id="modal-mate-project">
    <div class="modal-dialog" style="width:1350px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">物料基础<span id="projectInfo"></span>
                </h4>
            </div>
            <div class="modal-body">
                <form id="queryMateEnquiry">
                    <input type="hidden" id="matId" name="matId">
                    <div class="row">
                        <div class="form-inline">
                            <div class="form-group">
                                <label>类型</label>
                                <input type="text" id="matTypeId" name="matTypeId"
                                       class="form-control"
                                       placeholder="请输入原料类型">
                            </div>
                            <div class="form-group">
                                <label>材质</label>
                                <input type="text" id="matQualityId" name="matQualityId"
                                       class="form-control"
                                       placeholder="请输入原料材质">
                            </div>
                            <div class="form-group">
                                <label>规格</label>
                                <input type="text" id="matSpecId" name="matSpecId"
                                       class="form-control"
                                       placeholder="请输入原料规格">
                            </div>
                            <div class="form-group">
                                <label>宽度</label>
                                <input type="number" step="0.1" id="matWidth"
                                       name="matWidth" class="form-control"
                                       placeholder="请输入原料宽度">
                            </div>
                            <div class="form-group">
                                <label>长度</label>
                                <input type="number" step="0.1" id="matLength"
                                       name="matLength" class="form-control"
                                       placeholder="请输入原料长度">
                            </div>
                            <div class="form-group">
                                <label>米重/厚度</label>
                                <input type="number" step="0.1" id="matHeight"
                                       name="matHeight" class="form-control"
                                       placeholder="请输入原料米重/厚度">
                            </div>
                            <div class="form-group">
                                <label>原料分类</label>
                                <select id="materialKind" name="materialKind"
                                        class="form-control">
                                    <option value="板材">板材</option>
                                    <option value="型材">型材</option>
                                    <option value="" selected="selected">全部</option>
                                </select>
                            </div>
                            <button type="button" class="btn btn-success" id="btn_materialSearch">
                                <span class="Bold">搜索</span>
                            </button>
                        </div>
                    </div>
                </form>
                <table id="MateEnquiry-table1"></table>
            </div>
        </div>
    </div>
</div>
<!--加载首页-->
<section class="content-header">
    <h1>
        库存信息
    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label>项目编号</label>
                                    <input type="text" id="ityProCode" name="ityProCode"
                                           class="form-control"
                                           placeholder="请输入项目编号">
                                </div>
                                <div class="form-group">
                                    <label>项目名称</label>
                                    <input type="text" id="ityProName" name="ityProName"
                                           class="form-control"
                                           placeholder="请输入项目名称">
                                </div>
                                <div class="form-group">
                                    <label>跟踪号</label>
                                    <input type="text" id="ityTrackCode" name="ityTrackCode"
                                           class="form-control"
                                           placeholder="请输入跟踪号">
                                </div>
                                <div class="form-group">
                                    <label>物料描述</label>
                                    <input type="text" id="adjMatDesc" name="adjMatDesc"
                                           class="form-control"
                                           placeholder="请输入物料描述">
                                </div>
                                <div class="form-group">
                                    <label>
                                        在库类型
                                    </label>
                                    <select id="ityInType" name="ityInType" class="form-control">
                                        <option value="" selected="selected">全部</option>
                                        <option value="1">库存</option>
                                        <option value="2">项目</option>
                                    </select>
                                </div>
                                <button type="button" class="btn btn-success" id="btn_search">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="row" id="toolbar1">
                    <a href="javascript:void(0);" class="btn btn-info"
                       onclick="openAddstock()">
                        <span class="Bold">添加新库存</span>
                    </a>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    var table, table1;

    /** 根据ityId查询库存信息库存调整 */
    function openCreatProjectModal(ityId,ityWeight) {
        if(ityWeight === 0){
                js.modal.warning("重量为0的无法调整！");
        }else {
            js.post({
                url: ctx + "material/matInvManage/rawMatJustApply/ityId",
                data: {
                    ityId: ityId
                },
                success: function (result) {
                    $("#projectForm").fillData(result);
                    js.modal.open("modal-create-project");
                    js.modal.closeLoading();
                }
            })
        }
    }

    /** 正则表达式 */
    function clearNoNum(obj) {
        obj.value = obj.value.replace(/[^\d.-]/g, "");  //清除“数字”和“.”以外的字符
        obj.value = obj.value.replace(/^\./g, "");  //验证第一个字符是数字而不是.
        obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
    }

    /** 调整时运算金额 */
    $("[name='ityPrice']").change(function () {
        var ityWeight = $("[name='ityWeight']").val();
        var ityPrice = $("[name='ityPrice']").val();
        var totalAmount = returnMaterialAmount(ityWeight, ityPrice);
        $("[name='ityAmount']").val(totalAmount);
    });

    /** 调整时运算重量 */
    $("[name='ityNum']").change(function () {
        var materialSpec = $("[name='matSpecId']").val();
        var materialLength = $("[name='matLength']").val();
        var materialWidth = $("[name='matWidth']").val();
        var materialHeight = $("[name='matHeight']").val();
        var ityNum = $("[name='ityNum']").val();
        var matFormulaType = $("[name='matFormulaType']").val();

        var totalWeight = returnMaterialWeight(materialSpec, materialLength, materialWidth, materialHeight, ityNum, matFormulaType);
        $("[name='ityWeight']").val(totalWeight);
    });

    /** 新增时运算重量 */
    $("[name='adjAfterNum']").change(function () {
        var materialSpec = $("[name='matSpecId']").val();
        var materialLength = $("[name='matLength']").val();
        var materialWidth = $("[name='matWidth']").val();
        var materialHeight = $("[name='matHeight']").val();
        var ityNum = $("[name='adjAfterNum']").val();
        var matFormulaType = $("[name='matFormulaType']").val();
        var totalWeight = returnMaterialWeight(materialSpec, materialLength, materialWidth, materialHeight, ityNum, matFormulaType);
        $("[name='adjAfterWeight']").val(totalWeight);
    });

    /** 新增时运算金额 */
    $("[name='adjPrice']").change(function () {
        var ityWeight = $("[name='adjAfterWeight']").val();
        var ityPrice = $("[name='adjPrice']").val();
        var totalAmount = returnMaterialAmount(ityWeight, ityPrice);
        $("[name='adjAmount']").val(totalAmount);
    });

    /** 取得原料行数据 */
    function getMaterial(d) {
        $("#projectForm [name='adjMatDesc']").val(d.matNameDesc);
        $("#projectForm [name='matFormulaType']").val(d.matFormulaType);
        $("#projectForm [name='matHeight']").val(d.matHeight);
        $("#projectForm [name='matLength']").val(d.matLength);
        $("#projectForm [name='matWidth']").val(d.matWidth);
        $("#projectForm [name='matSpecId']").val(d.matSpecId);
        $("#projectForm [name='matId']").val(d.matId);
        $("#projectFormStock [name='adjMatDesc']").val(d.matNameDesc);
        $("#projectFormStock [name='matFormulaType']").val(d.matFormulaType);
        $("#projectFormStock [name='matHeight']").val(d.matHeight);
        $("#projectFormStock [name='matLength']").val(d.matLength);
        $("#projectFormStock [name='matWidth']").val(d.matWidth);
        $("#projectFormStock [name='matSpecId']").val(d.matSpecId);
        $("#projectFormStock [name='matId']").val(d.matId);
        $("#projectFormStock [name='msName']").val(d.msName);
        $("#projectFormStock [name='msSpace']").val(d.msSpace);
        js.modal.hide("modal-mate-project");
        js.table.refresh(table1);
    }

    /** 调整变更后提交保存库存申请信息 */
    $("#btn-change-project").click(function () {
        if ($("#ityId").val()) {
            url = ctx + "material/matInvManage/rawMatJustApply/insert";
        }
        js.validSubmit({
            formId: "projectForm",
            url: url,
            data: new FormData($("#projectForm")[0]),
            success: function (result) {
                js.modal.success(result.msg);
                js.table.refresh(table);
                js.modal.hide("modal-create-project");
                js.modal.closeLoading();
            }
        });
    });

    /** 打开新增库存模态框 */
    function openAddstock() {

        $("input[name='adjBackDate']").val(new Date().format('yyyy-MM-dd'));
        js.updateDatePicker();
        js.modal.open("modal-create-stock");
    }

    /** 添加新库存 */
    $("#btn-change-Stock").click(function () {

        url = ctx + "material/matInvManage/rawMatJustApply/insertSt";
        js.validSubmit({
            formId: "projectFormStock",
            url: url,
            data: new FormData($("#projectFormStock")[0]),
            success: function (result) {
                js.modal.success(result.msg);
                js.table.refresh(table);
                js.modal.hide("modal-create-stock");
                js.modal.closeLoading();
            }
        });
    });

    /** 添加新库存验证 */
    js.validate.init("projectFormStock", {
        fields: {
            adjProjectCode: {
                validators: {
                    threshold: 6, //有6字符以上才发送ajax请求，（input中输入一个字符，插件会向服务器发送一次，设置限制，6字符以上才开始）
                    notEmpty: {
                        message: '请输入新项目编号'
                    },
                    // 发送ajax请求到后台查询，返回 valid：true或者false
                    callback: {
                        message: "项目号不存在",
                        callback: function (value, validator) {
                            var flag = false;
                            $.ajax({
                                url: ctx + 'material/changeOrder/codeExist', // 请求路径
                                type: 'POST',
                                async: false,	// 同步请求，必须是false
                                data: {
                                    ipmInProjectCode: $('#adjProjectCode').val() // 请求参数
                                },
                                success: function (res) {
                                    flag = $.parseJSON(res).valid;
                                }
                            });
                            return flag;
                        }
                    }
                }
            }
        }
    });

    /** 物料选择加载列表 */
    function openDailyDesc() {

        js.modal.open("modal-mate-project");
        table1 = js.table.init({
            id: "MateEnquiry-table1",
            showExport: false,
            queryForm: "queryMateEnquiry",
            url: ctx + "material/matInvManage/rawMatJustApply/MateEnquiryList",
            columns: [
                {
                    title: '序号', field: 'matId', width: '50',
                    formatter: function (value, row, index, field) {
                        return index + 1;
                    }
                },
                {title: '分类', field: 'materialKind', width: '150'},
                {title: '类型', field: 'matTypeId', width: '118'},
                {title: '材质', field: 'matQualityId', width: '100'},
                {title: '规格', field: 'matSpecId', width: '100'},
                {title: '宽度', field: 'matWidth', width: '100'},
                {title: '长度', field: 'matLength', width: '100'},
                {title: '米重/厚度', field: 'matHeight', width: '100'},
                {
                    title: '操作', width: '80',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push("<a class='btn btn-info btn-xs' href='javascript:void(0);' onclick='getMaterial(" + JSON.stringify(row) + " )'>选择</a>");
                        return actions.join('');
                    }
                }
            ]
        })
    }

    /** 加载库存列表信息 */
    $(function () {
        table = js.table.init({
            url: ctx + "material/matInvManage/rawMatJustApply/list",
            showColumns: false,
            showExport: false,
            toolbar: "#toolbar1",
            pageSize: 300,
            columns: [
                {
                    title: '序号', field: 'ityId', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: '在库数量', field: 'ityNum'},
                {title: '在库重量', field: 'ityWeight'},
                {title: '可用数量', field: 'ityAvaNum'},
                {title: '可用重量', field: 'ityAvaWeight'},
                {title: '单价', field: 'ityPrice'},
                {title: '跟踪号', field: 'ityTrackCode'},
                {title: '项目编号', field: 'ityProCode'},
                {title: '物料描述', field: 'adjMatDesc'},
                {title: '特殊说明', field: 'itySpec'},
                {title: '项目名称', field: 'ityProName'},
                {title: '库位', field: 'ityStoPlaceNum'},
                {
                    title: '在库类型', field: 'ityInType',
                    formatter: function (value, row, index) {
                        if (value === 1) {
                            return '库存';
                        } else if (value === 2) {
                            return '项目';
                        }
                    }
                },
                {
                    title: '操作', width: '80',
                    formatter: function (value, row, index) {
                        var actions = [];
                        if (row.editFlg == 1) {
                            actions.push('<a class="btn btn-xs btn-warning" href="javascript:void(0)" onclick="openCreatProjectModal(' + row.ityId + ','+row.ityWeight+')"> 调整</a> ');
                        }
                        return actions.join('');
                    }
                }

            ]
        });

        /** 表格搜索 */
        $("#btn_search").click(function () {
            js.table.search(table);
        });

        /** 物料表格搜索 */
        $("#btn_materialSearch").click(function () {
            js.table.search(table1);
        });

        /** 关闭新增库存信息模态框 */
        js.modal.hideEvent("modal-create-stock", function () {
            js.reset("projectFormStock");
        });

        /** 关闭调整模态框 */
        js.modal.hideEvent("modal-create-project", function () {
            js.reset("projectForm");
        });

        /** 项目编号 焦点离开 自动取得 名称 */
        $("#adjProjectCode").blur(function () {
            js.get({
                url: ctx + "material/changeOrder/findProject",
                data: {proCode: $("#adjProjectCode").val()},
                success: function (result) {
                    if (result.data == null) {
                        $("#adjProjectName").val("");
                    } else {
                        $("#adjProjectName").val(result.data.proName);
                    }
                }
            });
        });
    });
</script>
